import React, { Component } from 'react'
import MouseCatChild from './MouseCatChild'

export default class Mouse extends Component {
  render () {
    return (
      <div>
        {/* position就是子组件要给你传递的值，就是位置 */}
        {/* <MouseCatChild
          render={position => {
            // 父组件拿到模型，进行自定义渲染
            return (
              <div>
                position is {position.x},{position.y}
              </div>
            )
          }}
        /> */}
        {/* children属性 */}
        {/* <MouseCatChild
          children={position => {
            // 父组件拿到模型，进行自定义渲染
            return (
              <div>
                position is {position.x},{position.y}
              </div>
            )
          }}
        /> */}

        <MouseCatChild>
          {position => {
            // 父组件拿到模型，进行自定义渲染
            return (
              <div>
                children position is {position.x},{position.y}
              </div>
            )
          }}
        </MouseCatChild>
      </div>
    )
  }
}
